<template>
  <div id="app">
    <Child :msg="msg" :title="title" :name="name" @nameChange="fatherClick"/>
  </div>
</template>

<script>
import Child from './components/child.vue'

export default {
  name: 'app',
  components: {
    Child
  },
  data(){
    return {
      msg:'父组件消息',
      title:'父组件标题',
      name:'父组件'
    }
  },
  methods:{
    fatherClick(val){
      console.log('孙组件传回:'+ val)
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
